<extend name="Index/doc" />
<block name="css">
    <link rel="stylesheet" href="__STATIC__/common/editor/css/editormd.css?v=__VERSION__">
    <link rel="stylesheet" href="__STATIC__/doc/css/myeditor.css?v=__VERSION__">
    <link rel="stylesheet" href="__STATIC__/common/diff/diffview.css?v=__VERSION__">
</block>
<block name="main">
    <div class="review-header" id="reviewHeader">
        <h1>{$article['title']}</h1>
        <p class="review-author"><a href="{:U('/u/'.$author['id'])}">{$author.nick}</a> 提交于 <span class="icon-time"></span> {$article.create|date="Y-m-d H:i:s",###}</p>
        <div class="article-desc">
            <p>{$article.desc}</p>
        </div>
        <p class="deal-area">
            <if condition="$article['status'] eq 0">
                <if condition="$manager">
                    <a href="javascript:void(0);" id="agreeBtn" class="agree">通过</a>
                    <a href="javascript:void(0);" id="noagreeBtn" class="noagree">拒绝</a>
                <else/>
                    <a href="javascript:void(0);" class="agree">等待审阅中...</a>
                </if>
            <elseif condition="$article['status'] eq 1"/>
                <a href="javascript:void(0);" class="agree">审阅已通过</a>
            <elseif condition="$article['status'] eq -1"/>
                <a href="javascript:void(0);" class="noagree">审阅已拒绝</a>
            <else/>
                <a href="javascript:void(0);" class="noagree">未知异常</a>
            </if>
            <a href="javascript:history.back();">返回</a>
        </p>
        <div class="compare-area">
            <a href="javascript:void(0);" id="compareBtn1" title="左右对比"><i class="fa fa-arrows-h"></i></a>
            <a href="javascript:void(0);" id="compareBtn2" title="上下混合对比"><i class="fa fa-arrows-v"></i></a>
            <if condition="$manager and $article['status'] eq 0">
                <a href="javascript:void(0);" id="compareBtn3" title="编辑"><i class="fa fa-pencil"></i></a>
            </if>
        </div>
    </div>
    <div class="diff-area" id="diffoutput"> </div>
    <textarea class="hide" id="baseText">{$base}</textarea>
    <div class="edit-modal" id="modal2">
        <div class="edit-body">
            <div class="editor">
                <div id="layout" style="height:100%;">
                    <div id="editormd" style="margin:0;">
                        <textarea class="hide" id="newText">{$article['md']}</textarea>
                        <textarea class="hide" id="htmlText"></textarea>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <if condition="$manager and $article['status'] eq 0">
        <div class="modal hide" id="modal">
            <div class="modal-container">
                <div class="modal-content">
                    <div class="modal-header">
                        <button class="modal-close" id="modalClose"><span>&times;</span></button>
                        <h4 class="modal-title">审阅结果</h4>
                    </div>
                    <div class="modal-body">
                        <div class="form">
                            <div class="form-item">
                                <textarea class="description" id="descZone" spellcheck="false" placeholder="请对本次提交内容的作者做简单评语或回复..."></textarea>
                            </div>
                        </div>
                        <p class="edit-tip" id="resultMsg"> </p>
                    </div>
                    <div class="modal-footer">
                        <button class="modal-no" id="modalNo">取消</button>
                        <button class="modal-save no-save" id="modalOk">确认</button>
                    </div>
                </div>
            </div>
        </div>
        <form action="{:U('/review/'.$article['id'])}" method="post" class="hide" id="editForm">
            <input name="result" id="result" type="hidden"/>
            <input name="desc" id="desc" type="hidden"/>
            <input name="md" id="md" type="hidden"/>
            <input name="html" id="html" type="hidden"/>
        </form>
    </if>
    <a href="//doc.wooo.wang/suggest.html" target="_blank" id="bugBtn"><span class="fa red fa-arrow-left" onclick="$(this).parent().toggleClass('bugMark');return false;"></span> 提交BUG</a>
</block>
<block name="js">
    <script src="__STATIC__/common/js/jquery.min.js?v=__VERSION__"></script>
    <script src="__STATIC__/common/diff/diffview.js?v=__VERSION__"></script>
    <script src="__STATIC__/common/diff/difflib.js?v=__VERSION__"></script>
    <script>
        var author = '{$author.nick}', token = '{$token}', uid = {:UID}, did = {$doc.id}, oid = {$doc.bid}, cid = {$article.cid}, editorPath = "__STATIC__/common/editor/lib/";
    </script>
    <script src="__STATIC__/doc/js/reviewDiff.js?v=__VERSION__"></script>
    <if condition="$manager and $article['status'] eq 0">
        <script src="__STATIC__/common/editor/editormd.min.js?v=__VERSION__"></script>
        <script src="__STATIC__/doc/js/reviewEditor.js?v=__VERSION__"></script>
    </if>
</block>